{extend name='admin@public/content'}

{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("$classuri/add")}' data-title="新建广告位" class='layui-btn layui-btn-sm layui-btn-primary'>新建广告位</button>
<!--{/if}-->

<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除广告位</button>
<!--{/if}-->
{/block}
{/block}

{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">广告位名称</label>
        <div class="layui-input-inline">
            <input name="name" value="{$Think.get.name}" placeholder="请输入广告位名称" class="layui-input">
        </div>
    </div>

    <!--{if !empty($type_app_list)}-->
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">应用类型</label>
        <div class="layui-input-inline">
            <select name="type_app" lay-search>
                <option value=''> - 应用 - </option>
                {foreach $type_app_list as $key=>$type}
                <option  value='{$key}'>{$type}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <!--{/if}-->

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">广告类型</label>
        <div class="layui-input-inline">
            <select name="category_id" lay-search>
                <option value=''> - 类型 - </option>
                {foreach $type_list as $key=>$value}
                <option  value='{$key}'>{$value}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <!--<div class="layui-form-item layui-inline">-->
        <!--<label class="layui-form-label">状态</label>-->
        <!--<div class="layui-input-inline">-->
            <!--<select name="status" lay-search>-->
                <!--<option value=''> - 状态 - </option>-->
                <!--{foreach $cfg_status as $key=>$status}-->
                <!--<option  value='{$key}'>{$status}</option>-->
                <!--{/foreach}-->
            <!--</select>-->
        <!--</div>-->
    <!--</div>-->

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>

</form>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="" method="POST">
    <input type="hidden" value="resort" name="action"/>
    <table class="layui-table notevent" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td'>
                <input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
            </th>
            <th class='list-table-sort-td'>ID</th>
            <th class="w120">应用类型</th>
            <th class="w120">类型</th>
            <th>名称</th>
            <th class="w120">广告位尺寸</th>
            <th class="w150">创建时间</th>
            <th class='text-center w150'>操作</th>
        </tr>
        </thead>
        <tbody>
        {if isset($list) && $list != null}
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'/>
            </td>
            <td class='list-table-sort-td'>{$vo.id}</td>
            <td>{$vo.type_app_txt}</td>
            <td>{$vo.type_txt}</td>
            <td><a data-open='{:url("$classuri/ad")}?id={$vo.id}' href="javascript:void(0)">{$vo.name}</a></td>
            <td>{$vo.width} : {$vo.height}</td>
            <td>{$vo.create_time||date="Y-m-d H:i"}</td>
            <td class='text-center nowrap'>
                {if auth("$classuri/edit")}
                <span class="text-explode">|</span>
                <a data-modal='{:url("$classuri/edit")}?id={$vo.id}' href="javascript:void(0)">编辑</a>
                {/if}
                {if auth("$classuri/del")}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}' href="javascript:void(0)">删除</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        {/if}
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
</form>

<script>
    (function () {
        window.form.render();
    })();
</script>
{/block}
